package com.ajk.message.config.remote;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;

import com.ajk.message.service.EasemobService;
import com.ajk.message.service.JpushService;
import com.ajk.message.service.SmsSendService;


@Configuration
public class HttpInvokerServerConfig extends BaseRemoteConfig{
	//以下通过httpInvoker发布接口

    @Bean(name = "/jpushService")
    public HttpInvokerServiceExporter jpushService() {
        HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter();
        exporter.setService(jpushService);
        exporter.setServiceInterface(JpushService.class);
        return exporter;
    }

    @Bean(name = "/smsSendService")
    public HttpInvokerServiceExporter smsSendService() {
        HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter();
        exporter.setService(smsSendService);
        exporter.setServiceInterface(SmsSendService.class);
        return exporter;
    }
    
    @Bean(name = "/easemobService")
    public HttpInvokerServiceExporter easemobService() {
        HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter();
        exporter.setService(easemobService);
        exporter.setServiceInterface(EasemobService.class);
        return exporter;
    }

}